cmake_minimum_required(VERSION 3.16)

set(ROUTE_SANDBOX_SOURCES
    ${CMAKE_CURRENT_SOURCE_DIR}/route_dispatcher_sandbox.cpp
)

add_executable(route_dispatcher_sandbox
    ${ROUTE_SANDBOX_SOURCES}
)

target_link_libraries(route_dispatcher_sandbox
    PRIVATE
        agv_system_lib
        application
        Qt::Core
)

target_include_directories(route_dispatcher_sandbox
    PRIVATE
        ${CMAKE_SOURCE_DIR}/src
)

add_custom_command(TARGET route_dispatcher_sandbox POST_BUILD
    COMMAND ${CMAKE_COMMAND} -E make_directory
            "$<TARGET_FILE_DIR:route_dispatcher_sandbox>/config"
    COMMAND ${CMAKE_COMMAND} -E copy_if_different
            "${CMAKE_SOURCE_DIR}/config/app_config.json"
            "$<TARGET_FILE_DIR:route_dispatcher_sandbox>/config/app_config.json"
    COMMAND ${CMAKE_COMMAND} -E copy_directory
            "${CMAKE_SOURCE_DIR}/tests/maps"
            "$<TARGET_FILE_DIR:route_dispatcher_sandbox>/maps")
